package Z02IOStream.W07BufferedReader;

import java.io.*;

public class BufferTest {}

class TestBuffer{
    public static void main(String[] args) {
        File f = new File("c:/LOL.txt");

        try (FileReader fr = new FileReader(f);
             BufferedReader br = new BufferedReader(fr);
             ){
            while (true){
                String line = br.readLine();
                if (null == line)
                    break;
                    System.out.println(line);
            }

        }catch (IOException e){
            e.printStackTrace();
        }


    }
}

class TestBUffer1 {
    public static void main(String[] args) {


        File f = new File("c:/LOL.exe");
        try (
                FileWriter fw = new FileWriter(f);
                PrintWriter pw = new PrintWriter(fw);
                ){
            pw.println("111111");
            pw.println("222222");
            pw.println("333333");

        }catch (IOException e){
            e.printStackTrace();
        }


    }
}

class TestBUffer2{
    public static void main(String[] args) {
        File f = new File("C:lol.txt");
        try (FileWriter fr = new FileWriter(f);
            PrintWriter pw = new PrintWriter(fr);
        ) {
            pw.flush();
            pw.println("11111111111111111");
            pw.flush();
            pw.println("22222223233333332");
            pw.flush();
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}